/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * 
 * author : yuh351
 * 
 */
package com.casestudy1.yuh;

import com.casestudy1.main.MainMidlet;
import com.casestudy1.view.MainMenuForm;
import com.casestudy1.view.View;
import com.sun.lwuit.Button;
import com.sun.lwuit.ButtonGroup;
import com.sun.lwuit.ComboBox;
import com.sun.lwuit.Command;
import com.sun.lwuit.Dialog;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.RadioButton;
import com.sun.lwuit.TextField;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;
import com.sun.lwuit.plaf.Style;
import com.sun.lwuit.table.TableLayout;

/**
 *
 * @author Huy
 */
public class ReportTrafficInfoForm extends View implements ActionListener{

    private Label lbl_vitri, lbl_khuvuc, lbl_ngnhan, lbl_mucdo, lbl_ttrang;
    private TextField txt_vitri,txt_ngnhan;
    private ComboBox cbox_khuvuc;
    private RadioButton rbn_nhe, rbn_tb, rbn_ngtrong, rbn_dagq, rbn_chuagq;
    private ButtonGroup btg_mucdo, btg_ttrang;
    private Command cmd_cancel, cmd_submit;
    private Button btn_submit;
    
    public ReportTrafficInfoForm(final MainMidlet midlet) {
        super(midlet);
        setTitle("Cập nhật tình hình giao thông");
        Style titlestyle = new Style();
        titlestyle.setAlignment(CENTER);
        
        TableLayout mucdolayout = new TableLayout(4, 2);
        
        lbl_vitri = new Label("Vị trí : ");
        lbl_khuvuc = new Label("Khu vực : ");
        lbl_mucdo = new Label("Mức độ : ");
        lbl_ngnhan = new Label("Nguyên nhân : ");
        lbl_ttrang = new Label("Tình trạng : ");
        
        txt_vitri = new TextField();
        txt_ngnhan = new TextField();
        
        cbox_khuvuc = new ComboBox();
        cbox_khuvuc.addItem("Ba Đình");
        cbox_khuvuc.addItem("Cầu Giấy");
        cbox_khuvuc.addItem("Đống Đa");
        cbox_khuvuc.addItem("Hà Đông");
        cbox_khuvuc.addItem("Hai Bà Trưng");
        cbox_khuvuc.addItem("Hoàn Kiếm");
        cbox_khuvuc.addItem("Hoàng Mai");
        cbox_khuvuc.addItem("Long Biên");
        cbox_khuvuc.addItem("Tây Hồ");
        cbox_khuvuc.addItem("Thanh Xuân");
        
        
        rbn_nhe = new RadioButton("Nhẹ");
        rbn_tb = new RadioButton("Trung bình");
        rbn_ngtrong = new RadioButton("Nghiêm trọng");
        
        btg_mucdo = new ButtonGroup();
        btg_mucdo.add(rbn_nhe);
        btg_mucdo.add(rbn_tb);
        btg_mucdo.add(rbn_ngtrong);
        
        rbn_dagq = new RadioButton("Đã giải quyết");
        rbn_chuagq = new RadioButton("Chưa giải quyết");
        
        btg_ttrang = new ButtonGroup();
        btg_ttrang.add(rbn_dagq);
        btg_ttrang.add(rbn_chuagq);
        btg_ttrang.setSelected(rbn_chuagq);
        
        cmd_cancel = new Command("Hủy"){

            public void actionPerformed(ActionEvent evt) {
                new MainMenuForm(midlet).show();
            }
            
        };
        setBackCommand(cmd_cancel);
        
        cmd_submit = new Command("Cập nhật"){

            public void actionPerformed(ActionEvent evt) {
                Dialog.show("mes", "submit", "OK", null);
            }
            
        };
        
        btn_submit = new Button("Cập nhật");
        
        addComponent(lbl_vitri);
        addComponent(txt_vitri);
        
        addComponent(lbl_khuvuc);
        addComponent(cbox_khuvuc);
        
        addComponent(lbl_mucdo);
        addComponent(rbn_nhe);
        addComponent(rbn_tb);
        addComponent(rbn_ngtrong);
        
        addComponent(lbl_ngnhan);
        addComponent(txt_ngnhan);
        
        addComponent(lbl_ttrang);
        addComponent(rbn_chuagq);
        addComponent(rbn_dagq);
        
        addComponent(btn_submit);
        
        addCommand(cmd_cancel);
        addCommand(cmd_submit);
        
    }
    
    public void actionPerformed(ActionEvent ae) {
    }
    
}
